<template>
  <el-row :gutter="40" class="panel-group">
    <el-col :xs="12" :sm="12" :lg="6" class="card-panel-col">
      <div class="card-panel" @click="handleSetLineChartData('demo01')">
        <div class="card-panel-text">我是测试项目1呢</div>
        <count-to :start-val="0" :end-val="102400" :duration="2600" class="card-panel-num"/>
      </div>
    </el-col>
    <el-col :xs="12" :sm="12" :lg="6" class="card-panel-col">
      <div class="card-panel" @click="handleSetLineChartData('demo02')">
        <div class="card-panel-text">我是测试项目2呢</div>
        <count-to :start-val="0" :end-val="81212" :duration="3000" class="card-panel-num"/>
      </div>
    </el-col>
    <el-col :xs="12" :sm="12" :lg="6" class="card-panel-col">
      <div class="card-panel" @click="handleSetLineChartData('demo03')">
        <div class="card-panel-text">我是测试项目3呢</div>
        <count-to :start-val="0" :end-val="9280" :duration="3200" class="card-panel-num"/>
      </div>
    </el-col>
    <el-col :xs="12" :sm="12" :lg="6" class="card-panel-col">
      <div class="card-panel" @click="handleSetLineChartData('demo04')">
        <div class="card-panel-text">我是测试项目4呢</div>
        <count-to :start-val="0" :end-val="13600" :duration="3600" class="card-panel-num"/>
      </div>
    </el-col>
  </el-row>
</template>

<script>
import CountTo from 'vue-count-to'
export default {
  components: { CountTo },
  methods: {
    handleSetLineChartData(type) {
      this.$emit('handleSetLineChartData', type)
    }
  }
}
</script>

<style rel="stylesheet/scss" lang="scss" scoped>
.panel-group {
  margin-top: 18px;
  .card-panel-col{
    margin-bottom: 32px;
  }
  .card-panel {
    padding: 20px 10px;
    height: 108px;
    cursor: pointer;
    font-size: 12px;
    position: relative;
    overflow: hidden;
    text-align: center;
    background: #fff;
    box-shadow: 4px 4px 40px rgba(0, 0, 0, .3);
    border-color: rgba(0, 0, 0, .05);
    border-radius: 5px;
    .card-panel-text {
      font-weight: bold;
      line-height: 18px;
      color: #444;
      font-size: 16px;
      margin-bottom: 12px;
      }
    .card-panel-num {
      font-size: 20px;
      color: rgb(3, 0, 0);
    }
  }
}
</style>
